package com.shanzmoo.db.logistics.entity.vo;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.shanzmoo.db.logistics.entity.DeliveryBillEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 商城订单分页返回对象
 * @author Gzhao 2021/1/6
 */
@Data
@ApiModel("发货单分页返回对象")
public class DeliveryBillPageVO implements Serializable {

    private static final long serialVersionUID = 1758L;

    @ApiModelProperty("发货ID")
    private Integer id;

    @ApiModelProperty("发货单号")
    private String billNo;

    @ApiModelProperty("订单号")
    private String orderNo;

    @ApiModelProperty("订单类型：0-门店订单，1-商城订单，2-售后订单，3-第三方订单")
    private Integer orderType;

    @ApiModelProperty("门店")
    private String outletName;

    @ApiModelProperty("创建人")
    private String createUser;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    public static DeliveryBillPageVO create(DeliveryBillEntity deliveryBillEntity) {
        return JSON.parseObject(JSON.toJSONString(deliveryBillEntity), DeliveryBillPageVO.class);
    }
}
